package com.hc.config;

import com.hc.interceptor.LoginvalidateInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class WebConfig implements WebMvcConfigurer {


    Logger logger = LoggerFactory.getLogger(LoginvalidateInterceptor.class.getName());


    @Autowired
    LoginvalidateInterceptor loginvalidateInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        logger.debug("WebConfig中的addInterceptors方法被调用");

        //.addPathPatterns("/**");表示拦截所有的控制器请求
      //  registry.addInterceptor(loginvalidateInterceptor)
           //     .addPathPatterns("/**")
           //     .excludePathPatterns("/sysUserController/userLogin"); //排除用户登录的方法

               // .addPathPatterns("/sysRoleController/**");
    }
}
